Minimum Generic Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Finds the minimum value in a collection. A supplied Comparison<T> delegate is used to compare the items in the collection.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public static T Minimum<T>(
	IEnumerable<T> collection,
	Comparison<T> comparison
)
Visual Basic (Declaration)
Public Shared Function Minimum(Of T) ( _
	collection As IEnumerable(Of T), _
	comparison As Comparison(Of T) _
) As T
Visual C++
public:
generic<typename T>
static T Minimum (
	IEnumerable<T>^ collection, 
	Comparison<T>^ comparison
)

Parameters

collection
IEnumerable<(Of <T>)>
The collection to search.
comparison
Comparison<(Of <T>)>
The comparison used to compare items in the collection.

Return Value

The smallest item in the collection.

Type Parameters

T
The type of items in the collection.

Exceptions

ExceptionCondition
System..::InvalidOperationExceptionThe collection is empty.
System..::ArgumentNullExceptioncollection or comparison is null.

See Also